home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / CMICCProfile.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  27.1 KB  |  821 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMICCProfile.p
  3.  
  4.      Contains:    ICC Profile Format Definitions
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT CMICCProfile;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __CMICCPROFILE__}
  27. {$SETC __CMICCPROFILE__ := 1}
  28.  
  29. {$I+}
  30. {$SETC CMICCProfileIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36.  
  37.  
  38. {$PUSH}
  39. {$ALIGN MAC68K}
  40. {$LibExport+}
  41.  
  42. { Current CMProfile.header.profileVersion Major: 2, Minor: 0, Stage: Developement (x20), Prerelease:0x01 }
  43.  
  44. CONST
  45.     cmCS2ProfileVersion            = $02000000;
  46.  
  47. { Current Major version number }
  48.     cmCurrentProfileMajorVersion = $02000000;
  49.  
  50. { magic cookie number for anonymous file ID }
  51.     cmMagicNumber                = 'acsp';
  52.  
  53. { ColorSync profile version 1.0 }
  54.     cmCS1ProfileVersion            = $00000100;
  55.  
  56.  
  57. {**********************************************************************}
  58. {************** ColorSync 2.0 profile specification *******************}
  59. {**********************************************************************}
  60. {*** flags field  ***}
  61.     cmICCReservedFlagsMask        = $0000FFFF;                    {  these bits of the flags field are defined and reserved by ICC  }
  62.     cmEmbeddedMask                = $00000001;                    {  if bit 0 is 0 then not embedded profile, if 1 then embedded profile  }
  63.     cmEmbeddedUseMask            = $00000002;                    {  if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only  }
  64.     cmCMSReservedFlagsMask        = $FFFF0000;                    {  these bits of the flags field are defined and reserved by CMS vendor  }
  65.     cmQualityMask                = $00030000;                    {  if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best  }
  66.     cmInterpolationMask            = $00040000;                    {  if bit 18 is 0 then interpolation, if 1 then lookup only  }
  67.     cmGamutCheckingMask            = $00080000;                    {  if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info  }
  68.  
  69. { copyright-protection flag options }
  70.     cmEmbeddedProfile            = 0;                            {  0 is not embedded profile, 1 is embedded profile  }
  71.     cmEmbeddedUse                = 1;                            {  0 is to use anywhere, 1 is to use as embedded profile only  }
  72.  
  73. { speed and quality flag options }
  74.     cmNormalMode                = 0;                            {  it uses the least significent two bits in the high word of flag  }
  75.     cmDraftMode                    = 1;                            {  it should be evaulated like this: right shift 16 bits first, mask off the  }
  76.     cmBestMode                    = 2;                            {  high 14 bits, and then compare with the enum to determine the option value  }
  77.  
  78.  
  79. {*** deviceAttributes fields ***}
  80.     cmICCReservedAttr0Mask        = $0000FFFF;                    {  these bits of the deviceAttributes[0] field are defined and reserved by ICC  }
  81.     cmReflectiveTransparentMask    = $00000001;                    {  if bit 0 is 0 then reflective media, if 1 then transparency media  }
  82.     cmGlossyMatteMask            = $00000002;                    {  if bit 1 is 0 then glossy, if 1 then matte  }
  83.     cmVendorReservedAttr0Mask    = $FFFF0000;                    {  these bits of the deviceAttributes[0] field are defined and reserved by device vendor  }
  84.     cmVendorReservedAttr1Mask    = $FFFFFFFF;                    {  these bits of the deviceAttributes[1] field are defined and reserved by device vendor  }
  85.  
  86. { device/media attributes element values  }
  87.     cmReflective                = 0;                            {  if bit 0 is 0 then reflective media, if 1 then transparency media  }
  88.     cmGlossy                    = 1;                            {  if bit 1 is 0 then glossy, if 1 then matte  }
  89.  
  90.  
  91. {*** renderingIntent field ***}
  92.     cmPerceptual                = 0;                            {  Photographic images  }
  93.     cmRelativeColorimetric        = 1;                            {  Logo Colors  }
  94.     cmSaturation                = 2;                            {  Business graphics  }
  95.     cmAbsoluteColorimetric        = 3;                            {  Logo Colors  }
  96.  
  97.  
  98.  
  99. { data type element values }
  100.     cmAsciiData                    = 0;
  101.     cmBinaryData                = 1;
  102.  
  103. { screen encodings  }
  104.     cmPrtrDefaultScreens        = 0;                            {  Use printer default screens.  0 is false, 1 is ture  }
  105.     cmLinesPer                    = 1;                            {  0 is LinesPerCm, 1 is LinesPerInch  }
  106.  
  107. { 2.0 tag type information }
  108.     cmNumHeaderElements            = 10;
  109.  
  110. { public tags }
  111.     cmAToB0Tag                    = 'A2B0';
  112.     cmAToB1Tag                    = 'A2B1';
  113.     cmAToB2Tag                    = 'A2B2';
  114.     cmBlueColorantTag            = 'bXYZ';
  115.     cmBlueTRCTag                = 'bTRC';
  116.     cmBToA0Tag                    = 'B2A0';
  117.     cmBToA1Tag                    = 'B2A1';
  118.     cmBToA2Tag                    = 'B2A2';
  119.     cmCalibrationDateTimeTag    = 'calt';
  120.     cmCharTargetTag                = 'targ';
  121.     cmCopyrightTag                = 'cprt';
  122.     cmDeviceMfgDescTag            = 'dmnd';
  123.     cmDeviceModelDescTag        = 'dmdd';
  124.     cmGamutTag                    = 'gamt';
  125.     cmGrayTRCTag                = 'kTRC';
  126.     cmGreenColorantTag            = 'gXYZ';
  127.     cmGreenTRCTag                = 'gTRC';
  128.     cmLuminanceTag                = 'lumi';
  129.     cmMeasurementTag            = 'meas';
  130.     cmMediaBlackPointTag        = 'bkpt';
  131.     cmMediaWhitePointTag        = 'wtpt';
  132.     cmNamedColorTag                = 'ncol';
  133.     cmNamedColor2Tag            = 'ncl2';
  134.     cmPreview0Tag                = 'pre0';
  135.     cmPreview1Tag                = 'pre1';
  136.     cmPreview2Tag                = 'pre2';
  137.     cmProfileDescriptionTag        = 'desc';
  138.     cmProfileSequenceDescTag    = 'pseq';
  139.     cmPS2CRD0Tag                = 'psd0';
  140.     cmPS2CRD1Tag                = 'psd1';
  141.     cmPS2CRD2Tag                = 'psd2';
  142.     cmPS2CRD3Tag                = 'psd3';
  143.     cmPS2CSATag                    = 'ps2s';
  144.     cmPS2RenderingIntentTag        = 'ps2i';
  145.     cmRedColorantTag            = 'rXYZ';
  146.     cmRedTRCTag                    = 'rTRC';
  147.     cmScreeningDescTag            = 'scrd';
  148.     cmScreeningTag                = 'scrn';
  149.     cmTechnologyTag                = 'tech';
  150.     cmUcrBgTag                    = 'bfd ';
  151.     cmViewingConditionsDescTag    = 'vued';
  152.     cmViewingConditionsTag        = 'view';
  153.  
  154. { custom tags }
  155.     cmPS2CRDVMSizeTag            = 'psvm';
  156.     cmVideoCardGammaTag            = 'vcgt';
  157.  
  158. { technology tag descriptions }
  159.     cmTechnologyFilmScanner        = 'fscn';
  160.     cmTechnologyReflectiveScanner = 'rscn';
  161.     cmTechnologyInkJetPrinter    = 'ijet';
  162.     cmTechnologyThermalWaxPrinter = 'twax';
  163.     cmTechnologyElectrophotographicPrinter = 'epho';
  164.     cmTechnologyElectrostaticPrinter = 'esta';
  165.     cmTechnologyDyeSublimationPrinter = 'dsub';
  166.     cmTechnologyPhotographicPaperPrinter = 'rpho';
  167.     cmTechnologyFilmWriter        = 'fprn';
  168.     cmTechnologyVideoMonitor    = 'vidm';
  169.     cmTechnologyVideoCamera        = 'vidc';
  170.     cmTechnologyProjectionTelevision = 'pjtv';
  171.     cmTechnologyCRTDisplay        = 'CRT ';
  172.     cmTechnologyPMDisplay        = 'PMD ';
  173.     cmTechnologyAMDisplay        = 'AMD ';
  174.     cmTechnologyPhotoCD            = 'KPCD';
  175.     cmTechnologyPhotoImageSetter = 'imgs';
  176.     cmTechnologyGravure            = 'grav';
  177.     cmTechnologyOffsetLithography = 'offs';
  178.     cmTechnologySilkscreen        = 'silk';
  179.     cmTechnologyFlexography        = 'flex';
  180.  
  181. { public type signatures }
  182.     cmSigCurveType                = 'curv';
  183.     cmSigDataType                = 'data';
  184.     cmSigDateTimeType            = 'dtim';
  185.     cmSigLut16Type                = 'mft2';
  186.     cmSigLut8Type                = 'mft1';
  187.     cmSigMeasurementType        = 'meas';
  188.     cmSigNamedColorType            = 'ncol';
  189.     cmSigNamedColor2Type        = 'ncl2';
  190.     cmSigProfileDescriptionType    = 'desc';
  191.     cmSigScreeningType            = 'scrn';
  192.     cmSigS15Fixed16Type            = 'sf32';
  193.     cmSigSignatureType            = 'sig ';
  194.     cmSigTextType                = 'text';
  195.     cmSigU16Fixed16Type            = 'uf32';
  196.     cmSigU1Fixed15Type            = 'uf16';
  197.     cmSigUInt32Type                = 'ui32';
  198.     cmSigUInt64Type                = 'ui64';
  199.     cmSigUInt8Type                = 'ui08';
  200.     cmSigViewingConditionsType    = 'view';
  201.     cmSigXYZType                = 'XYZ ';
  202.  
  203. { custom type signatures }
  204.     cmSigVideoCardGammaType        = 'vcgt';
  205.  
  206.  
  207. { Measurement type encodings }
  208. { Measurement Flare }
  209.     cmFlare0                    = $00000000;
  210.     cmFlare100                    = $00000001;
  211.  
  212. { Measurement Geometry    }
  213.     cmGeometryUnknown            = $00000000;
  214.     cmGeometry045or450            = $00000001;
  215.     cmGeometry0dord0            = $00000002;
  216.  
  217. { Standard Observer    }
  218.     cmStdobsUnknown                = $00000000;
  219.     cmStdobs1931TwoDegrees        = $00000001;
  220.     cmStdobs1964TenDegrees        = $00000002;
  221.  
  222. { Standard Illuminant }
  223.     cmIlluminantUnknown            = $00000000;
  224.     cmIlluminantD50                = $00000001;
  225.     cmIlluminantD65                = $00000002;
  226.     cmIlluminantD93                = $00000003;
  227.     cmIlluminantF2                = $00000004;
  228.     cmIlluminantD55                = $00000005;
  229.     cmIlluminantA                = $00000006;
  230.     cmIlluminantEquiPower        = $00000007;
  231.     cmIlluminantF8                = $00000008;
  232.  
  233. { Spot Function Value }
  234.     cmSpotFunctionUnknown        = 0;
  235.     cmSpotFunctionDefault        = 1;
  236.     cmSpotFunctionRound            = 2;
  237.     cmSpotFunctionDiamond        = 3;
  238.     cmSpotFunctionEllipse        = 4;
  239.     cmSpotFunctionLine            = 5;
  240.     cmSpotFunctionSquare        = 6;
  241.     cmSpotFunctionCross            = 7;
  242.  
  243. { Color Space Signatures }
  244.     cmXYZData                    = 'XYZ ';
  245.     cmLabData                    = 'Lab ';
  246.     cmLuvData                    = 'Luv ';
  247.     cmYxyData                    = 'Yxy ';
  248.     cmRGBData                    = 'RGB ';
  249.     cmGrayData                    = 'GRAY';
  250.     cmHSVData                    = 'HSV ';
  251.     cmHLSData                    = 'HLS ';
  252.     cmCMYKData                    = 'CMYK';
  253.     cmCMYData                    = 'CMY ';
  254.     cmMCH5Data                    = 'MCH5';
  255.     cmMCH6Data                    = 'MCH6';
  256.     cmMCH7Data                    = 'MCH7';
  257.     cmMCH8Data                    = 'MCH8';
  258.     cmNamedData                    = 'NAME';
  259.  
  260. { profileClass enumerations }
  261.     cmInputClass                = 'scnr';
  262.     cmDisplayClass                = 'mntr';
  263.     cmOutputClass                = 'prtr';
  264.     cmLinkClass                    = 'link';
  265.     cmAbstractClass                = 'abst';
  266.     cmColorSpaceClass            = 'spac';
  267.     cmNamedColorClass            = 'nmcl';
  268.  
  269. { platform enumerations }
  270.     cmMacintosh                    = 'APPL';
  271.     cmMicrosoft                    = 'MSFT';
  272.     cmSolaris                    = 'SUNW';
  273.     cmSiliconGraphics            = 'SGI ';
  274.     cmTaligent                    = 'TGNT';
  275.  
  276. { ColorSync 1.0 elements }
  277.     cmCS1ChromTag                = 'chrm';
  278.     cmCS1TRCTag                    = 'trc ';
  279.     cmCS1NameTag                = 'name';
  280.     cmCS1CustTag                = 'cust';
  281.  
  282. { General element data types }
  283.  
  284. TYPE
  285.     CMDateTimePtr = ^CMDateTime;
  286.     CMDateTime = RECORD
  287.         year:                    UInt16;
  288.         month:                    UInt16;
  289.         dayOfTheMonth:            UInt16;
  290.         hours:                    UInt16;
  291.         minutes:                UInt16;
  292.         seconds:                UInt16;
  293.     END;
  294.  
  295.     CMFixedXYZColorPtr = ^CMFixedXYZColor;
  296.     CMFixedXYZColor = RECORD
  297.         X:                        Fixed;
  298.         Y:                        Fixed;
  299.         Z:                        Fixed;
  300.     END;
  301.  
  302.     CMXYZComponent                        = UInt16;
  303.     CMXYZColorPtr = ^CMXYZColor;
  304.     CMXYZColor = RECORD
  305.         X:                        CMXYZComponent;
  306.         Y:                        CMXYZComponent;
  307.         Z:                        CMXYZComponent;
  308.     END;
  309.  
  310.     CM2HeaderPtr = ^CM2Header;
  311.     CM2Header = RECORD
  312.         size:                    UInt32;                                    {  This is the total size of the Profile  }
  313.         CMMType:                OSType;                                    {  CMM signature,  Registered with CS2 consortium   }
  314.         profileVersion:            UInt32;                                    {  Version of CMProfile format  }
  315.         profileClass:            OSType;                                    {  input, display, output, devicelink, abstract, or color conversion profile type  }
  316.         dataColorSpace:            OSType;                                    {  color space of data  }
  317.         profileConnectionSpace:    OSType;                                    {  profile connection color space  }
  318.         dateTime:                CMDateTime;                                {  date and time of profile creation  }
  319.         CS2profileSignature:    OSType;                                    {  'acsp' constant ColorSync 2.0 file ID  }
  320.         platform:                OSType;                                    {  primary profile platform, Registered with CS2 consortium  }
  321.         flags:                    UInt32;                                    {  profile flags  }
  322.         deviceManufacturer:        OSType;                                    {  Registered with ICC consortium  }
  323.         deviceModel:            UInt32;                                    {  Registered with ICC consortium  }
  324.         deviceAttributes:        ARRAY [0..1] OF UInt32;                    {  Attributes like paper type  }
  325.         renderingIntent:        UInt32;                                    {  preferred rendering intent of tagged object  }
  326.         white:                    CMFixedXYZColor;                        {  profile illuminant  }
  327.         creator:                OSType;                                    {  profile creator  }
  328.         reserved:                PACKED ARRAY [0..43] OF CHAR;            {  reserved for future use  }
  329.     END;
  330.  
  331.     CMTagRecordPtr = ^CMTagRecord;
  332.     CMTagRecord = RECORD
  333.         tag:                    OSType;                                    {  Registered with CS2 consortium  }
  334.         elementOffset:            UInt32;                                    {  Relative to start of CMProfile  }
  335.         elementSize:            UInt32;
  336.     END;
  337.  
  338.     CMTagElemTablePtr = ^CMTagElemTable;
  339.     CMTagElemTable = RECORD
  340.         count:                    UInt32;
  341.         tagList:                ARRAY [0..0] OF CMTagRecord;            {  Variable size  }
  342.     END;
  343.  
  344. { External 0x02002001 CMProfile }
  345.     CM2ProfilePtr = ^CM2Profile;
  346.     CM2Profile = RECORD
  347.         header:                    CM2Header;
  348.         tagTable:                CMTagElemTable;
  349.         elemData:                SInt8;                                    {  Tagged element storage. Variable size  }
  350.     END;
  351.  
  352.     CM2ProfileHandle                    = ^CM2ProfilePtr;
  353. { Tag Type Definitions }
  354.     CMCurveTypePtr = ^CMCurveType;
  355.     CMCurveType = RECORD
  356.         typeDescriptor:            OSType;                                    {  'curv'  }
  357.         reserved:                UInt32;                                    {  fill with 0x00  }
  358.         countValue:                UInt32;                                    {  number of entries in table that follows  }
  359.         data:                    ARRAY [0..0] OF UInt16;                    {  Tagged element storage. Variable size  }
  360.     END;
  361.  
  362.     CMDataTypePtr = ^CMDataType;
  363.     CMDataType = RECORD
  364.         typeDescriptor:            OSType;                                    {  'data'  }
  365.         reserved:                UInt32;                                    {  fill with 0x00  }
  366.         dataFlag:                UInt32;                                    {  0 = ASCII, 1 = binary  }
  367.         data:                    SInt8;                                    {  Tagged element storage. Variable size  }
  368.     END;
  369.  
  370.     CMDateTimeTypePtr = ^CMDateTimeType;
  371.     CMDateTimeType = RECORD
  372.         typeDescriptor:            OSType;                                    {  'dtim'  }
  373.         reserved:                UInt32;
  374.         dateTime:                CMDateTime;
  375.     END;
  376.  
  377.     CMLut16TypePtr = ^CMLut16Type;
  378.     CMLut16Type = RECORD
  379.         typeDescriptor:            OSType;                                    {  'mft2'  }
  380.         reserved:                UInt32;                                    {  fill with 0x00  }
  381.         inputChannels:            SInt8;                                    {  Number of input channels  }
  382.         outputChannels:            SInt8;                                    {  Number of output channels  }
  383.         gridPoints:                SInt8;                                    {  Number of clutTable grid points  }
  384.         reserved2:                SInt8;                                    {  fill with 0x00  }
  385.         matrix:                    ARRAY [0..2,0..2] OF Fixed;                {   }
  386.         inputTableEntries:        UInt16;                                    {   }
  387.         outputTableEntries:        UInt16;                                    {   }
  388.         inputTable:                ARRAY [0..0] OF UInt16;                    {  Variable size  }
  389.         CLUT:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  390.         outputTable:            ARRAY [0..0] OF UInt16;                    {  Variable size  }
  391.     END;
  392.  
  393.     CMLut8TypePtr = ^CMLut8Type;
  394.     CMLut8Type = RECORD
  395.         typeDescriptor:            OSType;                                    {  'mft1'  }
  396.         reserved:                UInt32;                                    {  fill with 0x00  }
  397.         inputChannels:            SInt8;                                    {   }
  398.         outputChannels:            SInt8;                                    {   }
  399.         gridPoints:                SInt8;                                    {   }
  400.         reserved2:                SInt8;                                    {  fill with 0x00  }
  401.         matrix:                    ARRAY [0..2,0..2] OF Fixed;                {   }
  402.         inputTable:                PACKED ARRAY [0..255] OF UInt8;            {  fixed size of 256  }
  403.         CLUT:                    PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  404.         outputTable:            PACKED ARRAY [0..255] OF UInt8;            {  fixed size of 256  }
  405.     END;
  406.  
  407.     CMMeasurementTypePtr = ^CMMeasurementType;
  408.     CMMeasurementType = RECORD
  409.         typeDescriptor:            OSType;                                    {  'meas'  }
  410.         reserved:                UInt32;                                    {  fill with 0x00  }
  411.         standardObserver:        UInt32;                                    {  0 : unknown, 1 : CIE 1931, 2 : CIE 1964  }
  412.         backingXYZ:                CMFixedXYZColor;                        {  absolute XYZ values of backing  }
  413.         geometry:                UInt32;                                    {  0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0  }
  414.         flare:                    UInt32;                                    {  0 : 0%, 1 : 100% flare  }
  415.         illuminant:                UInt32;                                    {  standard illuminant  }
  416.     END;
  417.  
  418.     CMNamedColorTypePtr = ^CMNamedColorType;
  419.     CMNamedColorType = RECORD
  420.         typeDescriptor:            OSType;                                    {  'ncol'  }
  421.         reserved:                UInt32;                                    {  fill with 0x00  }
  422.         vendorFlag:                UInt32;                                    {   }
  423.         count:                    UInt32;                                    {  count of named colors in array that follows  }
  424.         prefixName:                SInt8;                                    {  Variable size, max = 32, to access fields after this one, have to count bytes  }
  425.         suffixName:                SInt8;                                    {  Variable size, max = 32  }
  426.         data:                    SInt8;                                    {  varaible size data as explained below  }
  427.     END;
  428.  
  429. {    
  430.     A variable size array of structs appears as the last block of data
  431.     in the above struct, CMNamedColorType.  The data structure
  432.     is as follows: (example in C)
  433.     
  434.     struct (                                             
  435.         unsigned char    rootName[1];                 * Variable size, max = 32 
  436.         unsigned char    colorCoords[1];                 * Variable size  
  437.     ) colorName[1];                                     * Variable size  
  438. }
  439.     CMNamedColor2TypePtr = ^CMNamedColor2Type;
  440.     CMNamedColor2Type = RECORD
  441.         typeDescriptor:            OSType;                                    {  'ncl2'  }
  442.         reserved:                UInt32;                                    {  fill with 0x00  }
  443.         vendorFlag:                UInt32;                                    {  lower 16 bits reserved for ICC use  }
  444.         count:                    UInt32;                                    {  count of named colors in array that follows  }
  445.         deviceChannelCount:        UInt32;                                    {  number of device channels, 0 indicates no device value available  }
  446.         prefixName:                PACKED ARRAY [0..31] OF UInt8;            {  32 byte field.  7 bit ASCII null terminated  }
  447.         suffixName:                PACKED ARRAY [0..31] OF UInt8;            {  32 byte field.  7 bit ASCII null terminated  }
  448.         data:                    SInt8;                                    {  varaible size data as explained below  }
  449.     END;
  450.  
  451. {    
  452.     A variable size array of structs appears as the last block of data
  453.     in the above struct, CMNamedColor2Type.  The data structure
  454.     is as follows: (example in C)
  455.     
  456.     struct (                                             
  457.         unsigned char    rootName[1];                 * 32 byte field.  7 bit ASCII null terminated
  458.         unsigned char    PCSColorCoords[1];             * Variable size  
  459.         unsigned char    DeviceColorCoords[1];         * Variable size  
  460.     ) colorName2[1];                                 * Variable size  
  461. }
  462.  
  463.     CMTextDescriptionTypePtr = ^CMTextDescriptionType;
  464.     CMTextDescriptionType = PACKED RECORD
  465.         typeDescriptor:            OSType;                                    {  'desc'  }
  466.         reserved:                UInt32;                                    {  fill with 0x00  }
  467.         ASCIICount:                UInt32;                                    {  the count of "bytes"  }
  468.         ASCIIName:                PACKED ARRAY [0..1] OF UInt8;            {  Variable size, to access fields after this one, have to count bytes  }
  469.         UniCodeCode:            UInt32;
  470.         UniCodeCount:            UInt32;                                    {  the count of characters, each character has two bytes  }
  471.         UniCodeName:            PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  472.         ScriptCodeCode:            INTEGER;
  473.         ScriptCodeCount:        UInt8;                                    {  the count of "bytes"  }
  474.         ScriptCodeName:            PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  475.     END;
  476.  
  477.     CMTextTypePtr = ^CMTextType;
  478.     CMTextType = RECORD
  479.         typeDescriptor:            OSType;                                    {  'text'  }
  480.         reserved:                UInt32;                                    {  fill with 0x00  }
  481.         text:                    SInt8;                                    {  count of text is obtained from tag size element  }
  482.     END;
  483.  
  484.     CMScreeningTypePtr = ^CMScreeningType;
  485.     CMScreeningType = RECORD
  486.         typeDescriptor:            OSType;                                    {  'scrn'  }
  487.         reserved:                UInt32;                                    {  fill with 0x00  }
  488.         screeningFlag:            UInt32;                                    {  bit 0 : use printer default screens, bit 1 : inch/cm  }
  489.         channelCount:            UInt32;
  490.         data:                    SInt8;                                    {  varaible size data as explained below  }
  491.     END;
  492.  
  493. {
  494.     A variable size array of structs appears as the last block of data
  495.     in the above struct, CMScreeningType.  The data structure
  496.     is as follows: (example in C)
  497.     
  498.     struct (
  499.         Fixed            frequency;
  500.         Fixed            angle;
  501.         unsigned long    sportFunction;
  502.      )    channelScreening[1];                        * Variable size 
  503. }
  504.     CMSignatureTypePtr = ^CMSignatureType;
  505.     CMSignatureType = RECORD
  506.         typeDescriptor:            OSType;                                    {  'sig '  }
  507.         reserved:                UInt32;                                    {  fill with 0x00  }
  508.         signature:                OSType;
  509.     END;
  510.  
  511.     CMS15Fixed16ArrayTypePtr = ^CMS15Fixed16ArrayType;
  512.     CMS15Fixed16ArrayType = RECORD
  513.         typeDescriptor:            OSType;                                    {  'sf32'  }
  514.         reserved:                UInt32;                                    {  fill with 0x00  }
  515.         value:                    ARRAY [0..0] OF Fixed;                    {  Variable size  }
  516.     END;
  517.  
  518.     CMU16Fixed16ArrayTypePtr = ^CMU16Fixed16ArrayType;
  519.     CMU16Fixed16ArrayType = RECORD
  520.         typeDescriptor:            OSType;                                    {  'uf32'  }
  521.         reserved:                UInt32;                                    {  fill with 0x00  }
  522.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size  }
  523.     END;
  524.  
  525.     CMUInt16ArrayTypePtr = ^CMUInt16ArrayType;
  526.     CMUInt16ArrayType = RECORD
  527.         typeDescriptor:            OSType;                                    {  'ui16'  }
  528.         reserved:                UInt32;                                    {  fill with 0x00  }
  529.         value:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  530.     END;
  531.  
  532.     CMUInt32ArrayTypePtr = ^CMUInt32ArrayType;
  533.     CMUInt32ArrayType = RECORD
  534.         typeDescriptor:            OSType;                                    {  'ui32'  }
  535.         reserved:                UInt32;                                    {  fill with 0x00  }
  536.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size  }
  537.     END;
  538.  
  539.     CMUInt64ArrayTypePtr = ^CMUInt64ArrayType;
  540.     CMUInt64ArrayType = RECORD
  541.         typeDescriptor:            OSType;                                    {  'ui64'  }
  542.         reserved:                UInt32;                                    {  fill with 0x00  }
  543.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size (x2)  }
  544.     END;
  545.  
  546.     CMUInt8ArrayTypePtr = ^CMUInt8ArrayType;
  547.     CMUInt8ArrayType = RECORD
  548.         typeDescriptor:            OSType;                                    {  'ui08'  }
  549.         reserved:                UInt32;                                    {  fill with 0x00  }
  550.         value:                    SInt8;                                    {  Variable size  }
  551.     END;
  552.  
  553.     CMViewingConditionsTypePtr = ^CMViewingConditionsType;
  554.     CMViewingConditionsType = RECORD
  555.         typeDescriptor:            OSType;                                    {  'view'  }
  556.         reserved:                UInt32;                                    {  fill with 0x00  }
  557.         illuminant:                CMFixedXYZColor;                        {  absolute XYZs of illuminant  in cd/m^2  }
  558.         surround:                CMFixedXYZColor;                        {  absolute XYZs of surround in cd/m^2  }
  559.         stdIlluminant:            UInt32;                                    {  see definitions of std illuminants  }
  560.     END;
  561.  
  562.     CMXYZTypePtr = ^CMXYZType;
  563.     CMXYZType = RECORD
  564.         typeDescriptor:            OSType;                                    {  'XYZ '  }
  565.         reserved:                UInt32;                                    {  fill with 0x00  }
  566.         XYZ:                    ARRAY [0..0] OF CMFixedXYZColor;        {  variable size XYZ tristimulus values  }
  567.     END;
  568.  
  569. { Profile sequence description type }
  570.     CMProfileSequenceDescTypePtr = ^CMProfileSequenceDescType;
  571.     CMProfileSequenceDescType = RECORD
  572.         typeDescriptor:            OSType;                                    {  'pseq '  }
  573.         reserved:                UInt32;                                    {  fill with 0x00  }
  574.         count:                    UInt32;                                    {  Number of descriptions  }
  575.         data:                    SInt8;                                    {  varaible size data as explained below  }
  576.     END;
  577.  
  578. {
  579.     A variable size array of structs appears as the last block of data
  580.     in the above struct, CMProfileSequenceDescType.  The data structure
  581.     is as follows: (example in C)
  582.     
  583.     struct (                                             
  584.         OSType            deviceMfg;                     * Device Manufacturer 
  585.         OSType            deviceModel;                 * Decvice Model 
  586.         unsigned long    attributes[2];                 * Device attributes 
  587.         OSType            technology;                     * Technology signature 
  588.         unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  589.         unsigned char    mfgDescASCIIName[2];         * Variable size 
  590.         unsigned long    mfgDescUniCodeCode;             
  591.         unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  592.         unsigned char    mfgDescUniCodeName[2];         * Variable size 
  593.         unsigned long    mfgDescScriptCodeCode;         
  594.         unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  595.         unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  596.         unsigned long    modelDescASCIICount;         * the count of "bytes" 
  597.         unsigned char    modelDescASCIIName[2];         * Variable size 
  598.         unsigned long    modelDescUniCodeCode;         
  599.         unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  600.         unsigned char    modelDescUniCodeName[2];     * Variable size 
  601.         short            modelDescScriptCodeCode;     
  602.         unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  603.         SInt8            filler;                         * For proper alignment across languages 
  604.         unsigned char    modelDescScriptCodeName[2];     * Variable size 
  605.     )    profileDescription[1];                         
  606. }
  607.  
  608. { Under color removal, black generation type }
  609.     CMUcrBgTypePtr = ^CMUcrBgType;
  610.     CMUcrBgType = RECORD
  611.         typeDescriptor:            OSType;                                    {  'bfd  '  }
  612.         reserved:                UInt32;                                    {  fill with 0x00  }
  613.         ucrCount:                UInt32;                                    {  Number of UCR entries  }
  614.         ucrValues:                ARRAY [0..0] OF UInt16;                    {  variable size  }
  615.         bgCount:                UInt32;                                    {  Number of BG entries  }
  616.         bgValues:                ARRAY [0..0] OF UInt16;                    {  variable size  }
  617.         ucrbgASCII:                SInt8;                                    {  null terminated ASCII string  }
  618.     END;
  619.  
  620.     CMIntentCRDVMSizePtr = ^CMIntentCRDVMSize;
  621.     CMIntentCRDVMSize = RECORD
  622.         renderingIntent:        LONGINT;                                {  rendering intent  }
  623.         VMSize:                    UInt32;                                    {  VM size taken up by the CRD  }
  624.     END;
  625.  
  626.     CMPS2CRDVMSizeTypePtr = ^CMPS2CRDVMSizeType;
  627.     CMPS2CRDVMSizeType = RECORD
  628.         typeDescriptor:            OSType;                                    {  'psvm'  }
  629.         reserved:                UInt32;                                    {  fill with 0x00  }
  630.         count:                    UInt32;                                    {  number of intent entries  }
  631.         intentCRD:                ARRAY [0..0] OF CMIntentCRDVMSize;        {  variable size  }
  632.     END;
  633.  
  634. { Video Card Gamma type }
  635.  
  636. CONST
  637.     cmVideoCardGammaTableType    = 0;
  638.     cmVideoCardGammaFormulaType    = 1;
  639.  
  640.  
  641.  
  642. TYPE
  643.     CMVideoCardGammaTablePtr = ^CMVideoCardGammaTable;
  644.     CMVideoCardGammaTable = RECORD
  645.         channels:                UInt16;                                    {  # of gamma channels (1 or 3)  }
  646.         entryCount:                UInt16;                                    {  1-based number of entries per channel  }
  647.         entrySize:                UInt16;                                    {  size on bytes of each entry  }
  648.         data:                    SInt8;                                    {  variable size data follows  }
  649.     END;
  650.  
  651.     CMVideoCardGammaFormulaPtr = ^CMVideoCardGammaFormula;
  652.     CMVideoCardGammaFormula = RECORD
  653.         redGamma:                Fixed;                                    {  must be > 0.0  }
  654.         redMin:                    Fixed;                                    {  must be > 0.0 and < 1.0  }
  655.         redMax:                    Fixed;                                    {  must be > 0.0 and < 1.0  }
  656.         greenGamma:                Fixed;                                    {  must be > 0.0  }
  657.         greenMin:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  658.         greenMax:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  659.         blueGamma:                Fixed;                                    {  must be > 0.0  }
  660.         blueMin:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  661.         blueMax:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  662.     END;
  663.  
  664.     CMVideoCardGammaPtr = ^CMVideoCardGamma;
  665.     CMVideoCardGamma = RECORD
  666.         tagType:                UInt32;
  667.         CASE INTEGER OF
  668.         0: (
  669.             table:                CMVideoCardGammaTable;
  670.             );
  671.         1: (
  672.             formula:            CMVideoCardGammaFormula;
  673.             );
  674.     END;
  675.  
  676.     CMVideoCardGammaTypePtr = ^CMVideoCardGammaType;
  677.     CMVideoCardGammaType = RECORD
  678.         typeDescriptor:            OSType;                                    {  'vcgt'  }
  679.         reserved:                UInt32;                                    {  fill with 0x00  }
  680.         gamma:                    CMVideoCardGamma;
  681.     END;
  682.  
  683. {**********************************************************************}
  684. {************** ColorSync 1.0 profile specification *******************}
  685. {**********************************************************************}
  686.  
  687. CONST
  688.     cmGrayResponse                = 0;
  689.     cmRedResponse                = 1;
  690.     cmGreenResponse                = 2;
  691.     cmBlueResponse                = 3;
  692.     cmCyanResponse                = 4;
  693.     cmMagentaResponse            = 5;
  694.     cmYellowResponse            = 6;
  695.     cmUcrResponse                = 7;
  696.     cmBgResponse                = 8;
  697.     cmOnePlusLastResponse        = 9;
  698.  
  699.  
  700. { Device types }
  701.     cmMonitorDevice                = 'mntr';
  702.     cmScannerDevice                = 'scnr';
  703.     cmPrinterDevice                = 'prtr';
  704.  
  705.  
  706.  
  707. TYPE
  708.     CMIStringPtr = ^CMIString;
  709.     CMIString = RECORD
  710.         theScript:                ScriptCode;
  711.         theString:                Str63;
  712.     END;
  713.  
  714. { Profile options }
  715.  
  716. CONST
  717.     cmPerceptualMatch            = $0000;                        {  Default. For photographic images  }
  718.     cmColorimetricMatch            = $0001;                        {  Exact matching when possible  }
  719.     cmSaturationMatch            = $0002;                        {  For solid colors  }
  720.  
  721. { Profile flags }
  722.     cmNativeMatchingPreferred    = $00000001;                    {  Default to native not preferred  }
  723.     cmTurnOffCache                = $00000002;                    {  Default to turn on CMM cache  }
  724.  
  725.  
  726. TYPE
  727.     CMMatchOption                        = LONGINT;
  728.     CMMatchFlag                            = LONGINT;
  729.     CMHeaderPtr = ^CMHeader;
  730.     CMHeader = RECORD
  731.         size:                    UInt32;
  732.         CMMType:                OSType;
  733.         applProfileVersion:        UInt32;
  734.         dataType:                OSType;
  735.         deviceType:                OSType;
  736.         deviceManufacturer:        OSType;
  737.         deviceModel:            UInt32;
  738.         deviceAttributes:        ARRAY [0..1] OF UInt32;
  739.         profileNameOffset:        UInt32;
  740.         customDataOffset:        UInt32;
  741.         flags:                    CMMatchFlag;
  742.         options:                CMMatchOption;
  743.         white:                    CMXYZColor;
  744.         black:                    CMXYZColor;
  745.     END;
  746.  
  747.     CMProfileChromaticitiesPtr = ^CMProfileChromaticities;
  748.     CMProfileChromaticities = RECORD
  749.         red:                    CMXYZColor;
  750.         green:                    CMXYZColor;
  751.         blue:                    CMXYZColor;
  752.         cyan:                    CMXYZColor;
  753.         magenta:                CMXYZColor;
  754.         yellow:                    CMXYZColor;
  755.     END;
  756.  
  757.     CMProfileResponsePtr = ^CMProfileResponse;
  758.     CMProfileResponse = RECORD
  759.         counts:                    ARRAY [0..8] OF UInt16;
  760.         data:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  761.     END;
  762.  
  763.     CMProfilePtr = ^CMProfile;
  764.     CMProfile = RECORD
  765.         header:                    CMHeader;
  766.         profile:                CMProfileChromaticities;
  767.         response:                CMProfileResponse;
  768.         profileName:            CMIString;
  769.         customData:                SInt8;                                    {  Variable size  }
  770.     END;
  771.  
  772.     CMProfileHandle                        = ^CMProfilePtr;
  773. {$IFC OLDROUTINENAMES }
  774.  
  775. CONST
  776.     kCMApplProfileVersion        = $00000100;
  777.  
  778.     grayResponse                = 0;
  779.     redResponse                    = 1;
  780.     greenResponse                = 2;
  781.     blueResponse                = 3;
  782.     cyanResponse                = 4;
  783.     magentaResponse                = 5;
  784.     yellowResponse                = 6;
  785.     ucrResponse                    = 7;
  786.     bgResponse                    = 8;
  787.     onePlusLastResponse            = 9;
  788.  
  789.     rgbData                        = 'RGB ';
  790.     cmykData                    = 'CMYK';
  791.     grayData                    = 'GRAY';
  792.     xyzData                        = 'XYZ ';
  793.  
  794.     monitorDevice                = 'mntr';
  795.     scannerDevice                = 'scnr';
  796.     printerDevice                = 'prtr';
  797.  
  798.  
  799. TYPE
  800.     XYZComponent                        = UInt16;
  801.     XYZColor                            = CMXYZColor;
  802.     XYZColorPtr                         = ^XYZColor;
  803.     CMResponseData                        = UInt16;
  804.     IString                                = CMIString;
  805.     IStringPtr                             = ^IString;
  806.     CMResponseColor                        = LONGINT;
  807.     responseColor                        = CMResponseColor;
  808. {$ENDC}  {OLDROUTINENAMES}
  809.  
  810.  
  811. {$ALIGN RESET}
  812. {$POP}
  813.  
  814. {$SETC UsingIncludes := CMICCProfileIncludes}
  815.  
  816. {$ENDC} {__CMICCPROFILE__}
  817.  
  818. {$IFC NOT UsingIncludes}
  819.  END.
  820. {$ENDC}
  821.